package com.shisfish.library.Impl;

import java.util.List;

import org.springframework.context.ApplicationContext;

import com.shisfish.library.Inter.INewsInter;
import com.shisfish.library.Model.News;
import com.shisfish.library.Utils.Global.GetACXmlUtils;

public class NewsImpl implements INewsInter {

	private ApplicationContext ac = GetACXmlUtils.getACXml();
	private INewsInter mapper = (INewsInter) ac.getBean("newsMapper");
	
	@Override
	public int insertOne(News t) {
		// TODO Auto-generated method stub
		return mapper.insertOne(t);
	}

	@Override
	public int insertAll(List<News> list) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateOne(News t) {
		// TODO Auto-generated method stub
		return mapper.updateOne(t);
	}

	@Override
	public int updateAll(List<News> list) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<News> selectById(int id) {
		// TODO Auto-generated method stub
		return mapper.selectById(id);
	}

	@Override
	public List<News> selectByKey(String key) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int countAll() {
		// TODO Auto-generated method stub
		return mapper.countAll();
	}

	@Override
	public List<News> selectAll() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int deleteOneById(int id) {
		// TODO Auto-generated method stub
		return mapper.deleteOneById(id);
	}

	@Override
	public int deleteAllById(List<?> ids) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteOneByKey(String key) {
		// TODO Auto-generated method stub
		return mapper.deleteOneByKey(key);
	}

	@Override
	public int deleteAllByKey(List<?> keys) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<News> selectAllPage(int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectAllPage(currentPage, pageSize);
	}

	@Override
	public int countByCho(String choose) {
		// TODO Auto-generated method stub
		return mapper.countByCho(choose);
	}

	@Override
	public List<News> selectByChoPage(String choose, int currentPage,
			int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByChoPage(choose, currentPage, pageSize);
	}

	@Override
	public int countByType(int type) {
		// TODO Auto-generated method stub
		return mapper.countByType(type);
	}

	@Override
	public List<News> selectByTypePage(int type, int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByTypePage(type, currentPage, pageSize);
	}

	@Override
	public News selectId(int id) {
		// TODO Auto-generated method stub
		return mapper.selectId(id);
	}

	@Override
	public int countByChoE(String choose, List<String> list) {
		// TODO Auto-generated method stub
		return mapper.countByChoE(choose, list);
	}

	@Override
	public List<News> selectByChoPageE(String choose, List<String> list,
			int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByChoPageE(choose, list, currentPage, pageSize);
	}

	@Override
	public int countAllE(List<String> list) {
		// TODO Auto-generated method stub
		return mapper.countAllE(list);
	}

	@Override
	public List<News> selectAllPageE(List<String> list, int currentPage,
			int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectAllPageE(list, currentPage, pageSize);
	}

	public int countByInter(int interest) {
		// TODO Auto-generated method stub
		return mapper.countByInter(interest);
	}

	public List<News> selectByInterPage(int interest, int currentPage,
			int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByInterPage(interest, currentPage, pageSize);
	}

	public int countCho(String choose, int type, String interest) {
		// TODO Auto-generated method stub
		return mapper.countCho(choose, type, interest);
	}

	public List<News> selectChoPage(String choose, int type, String interest,
			int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectChoPage(choose, type, interest, currentPage, pageSize);
	}

}
